<template>
  <div class="app-container">
    <el-card>
      <div slot="header" style="display:flex;align-items: center;justify-content: space-between;">
        <span>提现管理</span>
      </div>
      <div>
        <el-form :model="formData" label-width="100px" :inline="true">
          <el-form-item label="提现时间: ">
            <el-date-picker type="daterange" v-model="formData.dateRange"></el-date-picker>
          </el-form-item>
          <el-form-item label="提现状态: ">
            <el-select v-model="formData.status" placeholder="选择提现状态" clearable>
              <el-option label="处理中" value="0"></el-option>
              <el-option label="提现成功" value="1"></el-option>
            </el-select>
          </el-form-item>
          <el-button icon="el-icon-search" type="primary" @click="doSearch">查询</el-button>
        </el-form>
      </div>
      <el-table :data='listData' style="width: 100%" v-loading='loading'>
        <el-table-column label="#" width="50" type="index"></el-table-column>
        <el-table-column label="提现人" width="180" prop="nickName"></el-table-column>
        <el-table-column label="提现时间" width="170">
          <template slot-scope="{ row }">
            {{ row.occurDate | dateFilter }} {{ row.occurTime | timeFilter }}
          </template>
        </el-table-column>
        <el-table-column label="提现金额(元)" width="140" prop="occurBala" align="center"></el-table-column>
        <el-table-column label="提现状态" width="120">
          <template slot-scope="{ row }">
            {{ row.status === 0 ? '处理中' : '提现成功' }}
          </template>
        </el-table-column>
        <el-table-column label="备注"></el-table-column>
        <el-table-column label="操作" width="140" fixed="right">
          <template slot-scope="{ row }">
            <div>
              <el-button size="small" type="primary" v-if="row.status === 0" @click="reviewWithdraw(row)">审核通过</el-button>
              <el-button size="small" type="text" v-else disabled>已通过</el-button>
            </div>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination">
        <el-pagination :current-page.sync="pagination.pageNum" :page-sizes="[10, 20, 50, 100]" :page-size="pagination.pageSize" :total="pagination.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
      </div>
    </el-card>
  </div>
</template>

<script>
import mixin from './mixin';
export default {
  mixins: [mixin],
};
</script>

<style lang="scss" scoped>
@import './style.scss';
</style>
